<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增容器')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-boxInfo-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">编码：</label>
				<div class="col-sm-8">
					<input id="boxCode" name="boxCode" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">类型：1-料箱  2-托盘：</label>
				<div class="col-sm-8">
					<input id="boxType" name="boxType" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="boxMemo" name="boxMemo" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">所属单位：</label>
				<div class="col-sm-8">
					<input id="boxUnit" name="boxUnit" class="form-control" type="text">
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "boxInfo";
		$("#form-boxInfo-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	           var  result =  $.getServerData(prefix + "/add","POST", $.getFormData('form-boxInfo-add'));
	           if(result.code ==200){
				   var index = parent.layer.getFrameIndex(window.name);
				   parent.layer.close(index);
				   parent.$.modal.msgSuccess("保存成功");
				   parent.$.table.refresh();
			   }else {
			   		$.modal.msgSuccess(resule.msg);
			   }
	        }
	    }
	</script>
</body>
</html>
